package com.cloudOffice.service.Impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cloudOffice.mapper.OaProcessRecordMapper;
import com.cloudOffice.model.process.ProcessRecord;
import com.cloudOffice.model.system.SysUser;
import com.cloudOffice.service.OaProcessRecordService;
import com.cloudOffice.service.SysUserService;
import com.cloudOffice.storage.CommonStorage;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * 审批记录
 */
@Service
public class OaProcessRecordServiceImpl extends ServiceImpl<OaProcessRecordMapper, ProcessRecord> implements OaProcessRecordService {
	
	@Resource
	private SysUserService sysUserService;
	
	@Override
	public void record(Long processId, Integer status, String description) {
		Long userId = (Long) CommonStorage.getId();
		SysUser sysUser = sysUserService.getById(userId);
		ProcessRecord processRecord =
				ProcessRecord.builder().processId(processId).status(status).description(description).operateUser(sysUser.getName()).operateUserId(userId).build();
		save(processRecord);
	}
}
